# Copyright 2022 99Cloud, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# flake8: noqa
# fmt: off

"""change rsu status length

Revision ID: ffba191f33c8
Revises: 003114bb2d37
Create Date: 2022-07-25 09:20:40.299924

"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = 'ffba191f33c8'
down_revision = '003114bb2d37'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    connection = op.get_bind()
    if connection.engine.name == 'mysql':
        op.alter_column('rsu_tmp', 'rsu_status', type_=sa.String(32), nullable=False)
        op.alter_column('rsu', 'rsu_status', type_=sa.String(32), nullable=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    connection = op.get_bind()
    if connection.engine.name == 'mysql':
        op.alter_column('rsu_tmp', 'rsu_status', type_=sa.String(4), nullable=False)
        op.alter_column('rsu', 'rsu_status', type_=sa.String(4), nullable=False)
    # ### end Alembic commands ###
